<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button onclick="send()">发送</button>
    <script>
      function send() {
        fetch("http://192.168.0.125:8080/logIn", {
          method: "POST",
          // mode: "cors", //跨域请求
          headers: {
            "Content-Type": "application/json",
          },
          body: JSON.stringify({
            roleCode: "cwz",
            password: "123456",
          }),
        })
          .then((response) => response.json())
          .then((res) => {
            console.log(res);
          })
          .catch((e) => console.log("Oops, error", e));
      }
    </script>
  </body>
</html>
